using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.S_AddressTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HLShop_AddressTableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HLShop_AddressTableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HLShop_Address";
			dataTableMapping.ColumnMappings.Add("AddressID", "AddressID");
			dataTableMapping.ColumnMappings.Add("UserID", "UserID");
			dataTableMapping.ColumnMappings.Add("UserName", "UserName");
			dataTableMapping.ColumnMappings.Add("Address", "Address");
			dataTableMapping.ColumnMappings.Add("ZipCode", "ZipCode");
			dataTableMapping.ColumnMappings.Add("ConectPhone", "ConectPhone");
			dataTableMapping.ColumnMappings.Add("MobilePhone", "MobilePhone");
			dataTableMapping.ColumnMappings.Add("Email", "Email");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.DeleteCommand = new SqlCommand();
			this._adapter.DeleteCommand.Connection = this.Connection;
			this._adapter.DeleteCommand.CommandText = "DELETE FROM [HLShop_Address] WHERE (([AddressID] = @Original_AddressID))";
			this._adapter.DeleteCommand.CommandType = CommandType.Text;
			this._adapter.DeleteCommand.Parameters.Add(new SqlParameter("@Original_AddressID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AddressID", DataRowVersion.Original, false, null, "", "", ""));
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HLShop_Address] ([UserID], [UserName], [Address], [ZipCode], [ConectPhone], [MobilePhone], [Email]) VALUES (@UserID, @UserName, @Address, @ZipCode, @ConectPhone, @MobilePhone, @Email)";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@UserName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "UserName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Address", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "Address", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ZipCode", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ZipCode", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ConectPhone", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ConectPhone", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@MobilePhone", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "MobilePhone", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Email", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "Email", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand = new SqlCommand();
			this._adapter.UpdateCommand.Connection = this.Connection;
			this._adapter.UpdateCommand.CommandText = "UPDATE [HLShop_Address] SET [UserID] = @UserID, [UserName] = @UserName, [Address] = @Address, [ZipCode] = @ZipCode, [ConectPhone] = @ConectPhone, [MobilePhone] = @MobilePhone, [Email] = @Email WHERE (([AddressID] = @Original_AddressID))";
			this._adapter.UpdateCommand.CommandType = CommandType.Text;
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@UserName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "UserName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Address", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "Address", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ZipCode", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ZipCode", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ConectPhone", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ConectPhone", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@MobilePhone", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "MobilePhone", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Email", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "Email", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Original_AddressID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AddressID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[5];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT AddressID, UserID, UserName, Address, ZipCode, ConectPhone, MobilePhone, \r\n      Email\r\nFROM HLShop_Address\r\nWHERE (UserID = @userid)";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[0].Parameters.Add(new SqlParameter("@userid", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[1] = new SqlCommand();
			this._commandCollection[1].Connection = this.Connection;
			this._commandCollection[1].CommandText = "DELETE FROM [HLShop_Address] WHERE (([AddressID] = @AddressID))";
			this._commandCollection[1].CommandType = CommandType.Text;
			this._commandCollection[1].Parameters.Add(new SqlParameter("@AddressID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AddressID", DataRowVersion.Original, false, null, "", "", ""));
			this._commandCollection[2] = new SqlCommand();
			this._commandCollection[2].Connection = this.Connection;
			this._commandCollection[2].CommandText = "SELECT AddressID, UserID, UserName, Address, ZipCode, ConectPhone, MobilePhone, \r\n      Email\r\nFROM HLShop_Address\r\nWHERE (AddressID = @AddressID)";
			this._commandCollection[2].CommandType = CommandType.Text;
			this._commandCollection[2].Parameters.Add(new SqlParameter("@AddressID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AddressID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3] = new SqlCommand();
			this._commandCollection[3].Connection = this.Connection;
			this._commandCollection[3].CommandText = "INSERT INTO [HLShop_Address] ([UserID], [UserName], [Address], [ZipCode], [ConectPhone], [MobilePhone],[Email]) VALUES (@UserID, @UserName, @Address, @ZipCode, @ConectPhone, @MobilePhone,@Email)\r\nselect return @@identity";
			this._commandCollection[3].CommandType = CommandType.Text;
			this._commandCollection[4] = new SqlCommand();
			this._commandCollection[4].Connection = this.Connection;
			this._commandCollection[4].CommandText = "UPDATE [HLShop_Address] SET [UserID] = @UserID, [UserName] = @UserName, [Address] = @Address, [ZipCode] = @ZipCode, [ConectPhone] = @ConectPhone, [MobilePhone] = @MobilePhone ,Email=@Email  WHERE (([AddressID] = @Original_AddressID))";
			this._commandCollection[4].CommandType = CommandType.Text;
			this._commandCollection[4].Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@UserName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "UserName", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@Address", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, "Address", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@ZipCode", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ZipCode", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@ConectPhone", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "ConectPhone", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@MobilePhone", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "MobilePhone", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@Email", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "Email", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[4].Parameters.Add(new SqlParameter("@Original_AddressID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AddressID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Address.HLShop_AddressDataTable GetAddress(int? userid)
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			if (userid.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[0].Value = userid.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[0].Value = System.DBNull.Value;
			}
			S_Address.HLShop_AddressDataTable hLShop_AddressDataTable = new S_Address.HLShop_AddressDataTable();
			this.Adapter.Fill(hLShop_AddressDataTable);
			return hLShop_AddressDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Address.HLShop_AddressDataTable GetAddressByID(int AddressID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[2];
			this.Adapter.SelectCommand.Parameters[0].Value = AddressID;
			S_Address.HLShop_AddressDataTable hLShop_AddressDataTable = new S_Address.HLShop_AddressDataTable();
			this.Adapter.Fill(hLShop_AddressDataTable);
			return hLShop_AddressDataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_Address.HLShop_AddressDataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_Address dataSet)
		{
			return this.Adapter.Update(dataSet, "HLShop_Address");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
		[DataObjectMethod(DataObjectMethodType.Delete, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Delete(int Original_AddressID)
		{
			this.Adapter.DeleteCommand.Parameters[0].Value = Original_AddressID;
			ConnectionState state = this.Adapter.DeleteCommand.Connection.State;
			if ((this.Adapter.DeleteCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.DeleteCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.DeleteCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.DeleteCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Insert(int? UserID, string UserName, string Address, int? ZipCode, string ConectPhone, string MobilePhone, string Email)
		{
			if (UserID.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (UserName == null)
			{
				this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[1].Value = UserName;
			}
			if (Address == null)
			{
				this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[2].Value = Address;
			}
			if (ZipCode.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[3].Value = ZipCode.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
			}
			if (ConectPhone == null)
			{
				this.Adapter.InsertCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[4].Value = ConectPhone;
			}
			if (MobilePhone == null)
			{
				this.Adapter.InsertCommand.Parameters[5].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[5].Value = MobilePhone;
			}
			if (Email == null)
			{
				this.Adapter.InsertCommand.Parameters[6].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[6].Value = Email;
			}
			ConnectionState state = this.Adapter.InsertCommand.Connection.State;
			if ((this.Adapter.InsertCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.InsertCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.InsertCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.InsertCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(int? UserID, string UserName, string Address, int? ZipCode, string ConectPhone, string MobilePhone, string Email, int Original_AddressID)
		{
			if (UserID.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (UserName == null)
			{
				this.Adapter.UpdateCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[1].Value = UserName;
			}
			if (Address == null)
			{
				this.Adapter.UpdateCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[2].Value = Address;
			}
			if (ZipCode.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[3].Value = ZipCode.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
			}
			if (ConectPhone == null)
			{
				this.Adapter.UpdateCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[4].Value = ConectPhone;
			}
			if (MobilePhone == null)
			{
				this.Adapter.UpdateCommand.Parameters[5].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[5].Value = MobilePhone;
			}
			if (Email == null)
			{
				this.Adapter.UpdateCommand.Parameters[6].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[6].Value = Email;
			}
			this.Adapter.UpdateCommand.Parameters[7].Value = Original_AddressID;
			ConnectionState state = this.Adapter.UpdateCommand.Connection.State;
			if ((this.Adapter.UpdateCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.UpdateCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.UpdateCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.UpdateCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Delete, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int DeleteAddress(int AddressID)
		{
			SqlCommand sqlCommand = this.CommandCollection[1];
			sqlCommand.Parameters[0].Value = AddressID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int InsertAddress()
		{
			SqlCommand sqlCommand = this.CommandCollection[3];
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int UpdateAddress(int? UserID, string UserName, string Address, int? ZipCode, string ConectPhone, string MobilePhone, string Email, int Original_AddressID)
		{
			SqlCommand sqlCommand = this.CommandCollection[4];
			if (UserID.HasValue)
			{
				sqlCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (UserName == null)
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = UserName;
			}
			if (Address == null)
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = Address;
			}
			if (ZipCode.HasValue)
			{
				sqlCommand.Parameters[3].Value = ZipCode.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			if (ConectPhone == null)
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = ConectPhone;
			}
			if (MobilePhone == null)
			{
				sqlCommand.Parameters[5].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[5].Value = MobilePhone;
			}
			if (Email == null)
			{
				sqlCommand.Parameters[6].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[6].Value = Email;
			}
			sqlCommand.Parameters[7].Value = Original_AddressID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
	}
}
